package utils.nfc.xml
{
	public class Led
	{
		public static const STATUS_PERMANENT_RED:String	="permanent,red"; 
		public static const STATUS_PERMANENT_GREEN:String ="permanent,green"; 
		public static const STATUS_OFF:String ="off,"; 
		
		
		private var color:String;
		private var state:String;
		
		public function Led(status:String)
		{
			this.state = status.split(",")[0];
			this.color = status.split(",")[1];
		}
		
		public function toXML():XML{
			var led:XML = <led/>;
			led.@state = state;
			if (state != "off")
				led.@color = color;
			
			return led;
		}
	}
}